From ac26039ed7770e4a788cfc82c8a58bff9eacfb47 Mon Sep 17 00:00:00 2001 From: "vhanquez@kneesa.uk.xensource.com" Date: Thu, 1 Dec 2005 13:13:15 +0000 Subject: [PATCH] Prevent BVT scheduler to be set with a too low ctx_allow by applying a 10 microsecs low limit to the user parameter. Signed-off-by: Vincent Hanquez --- xen/common/sched_bvt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/common/sched_bvt.c b/xen/common/sched_bvt.c index c37b4bf2f9..37e2f1b7ec 100644 --- a/xen/common/sched_bvt.c +++ b/xen/common/sched_bvt.c @@ -67,6 +67,7 @@ struct bvt_cpu_info #define MCU (s32)MICROSECS(100) /* Minimum unit */ #define MCU_ADVANCE 10 /* default weight */ #define TIME_SLOP (s32)MICROSECS(50) /* allow time to slip a bit */ +#define CTX_MIN (s32)MICROSECS(10) /* Low limit for ctx_allow */ static s32 ctx_allow = (s32)MILLISECS(5); /* context switch allowance */ static inline void __add_to_runqueue_head(struct vcpu *d) @@ -297,7 +298,11 @@ static int bvt_ctl(struct sched_ctl_cmd *cmd) if ( cmd->direction == SCHED_INFO_PUT ) ctx_allow = params->ctx_allow; else + { + if ( ctx_allow < CTX_MIN ) + ctx_allow = CTX_MIN; params->ctx_allow = ctx_allow; + } return 0; } -- 2.30.2